package main

import (
	"errors"
	"fmt"
	"iot-base/common/config"
	"iot-base/common/ctrltype"
	"iot-base/common/logger"
	"iot-base/devc/common/loader"
	protocol "main/protocol"
	"sync"
)

func init() {
	loader.SetParam(false, "mm", 100, protocol.EachDev)
}

func main() {
	logger.Log.Warn("--------------------mm-----------------begin-----on--------" + config.PType)

	loader.SubCtrlHandler(func(pCmd *ctrltype.CtrlCmd) (map[string]interface{}, error) {
		if pCmd != nil {
			switch pCmd.ID {
			case "doRTSPPush":
				fmt.Println("********emm*****", pCmd.ID)
				protocol.DoRTSPPush(pCmd.ThingID, pCmd.Params)
				return nil, nil

			}
		}
		return nil, errors.New("cmd not supported")
	})
	wg := sync.WaitGroup{}
	wg.Add(1)
	wg.Wait()

}
